using System;
using System.Data;
using System.Collections;
using APP.QUANLY.Common;

namespace RMAS.DAL
{
    /// <summary>
    /// Summary description for DM_METERIAL.
    /// </summary>
    public class DM_METERIAL
    {
              private string _ID;
      private string _Name;
      private double _Price;
      private double _MinNumStore;
      private double _MaxNumStore;
      private string _UnitID;
      private string _GroupID;
      private string _IsUsed;
      private double _FirstBalancer;
      private string _IDPOS;
      private DM_WAREHOUSEMETERIALList _listDM_WAREHOUSEMETERIAL;
      private QT_EXPORTDETAIL_METERIALList _listQT_EXPORTDETAIL_METERIAL;
      private QT_EXPORTDETAIL_METERIAL_TEMPList _listQT_EXPORTDETAIL_METERIAL_TEMP;
      private QT_IMPORTDETIAL_METERIALList _listQT_IMPORTDETIAL_METERIAL;
      private QT_IMPORTDETIAL_METERIAL_TEMPList _listQT_IMPORTDETIAL_METERIAL_TEMP;
      private QT_QUANTITATIVEList _listQT_QUANTITATIVE;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
	      public bool IsSetID; 
      public bool IsIDNullable   
      { 
	 get { return false;  } 
      }
      public string ID
      {
         get { return _ID; }
         set 
	    { 
 		 _ID = value;
		IsSetID = true;
 	    }
      }
    public bool IsSetName; 
    public bool IsNameNullable   
    { 
		get { return false;  } 
    }
    public string Name
    {
        get{ return _Name;  }
        set
		{
			_Name = value;
			IsSetName = true;
		}
    }
    public bool IsSetPrice; 
    public bool IsPriceNullable   
    { 
		get { return false;  } 
    }
    public double Price
    {
        get{ return _Price;  }
        set
		{
			_Price = value;
			IsSetPrice = true;
		}
    }
    public bool IsSetMinNumStore; 
    public bool IsMinNumStoreNullable   
    { 
		get { return false;  } 
    }
    public double MinNumStore
    {
        get{ return _MinNumStore;  }
        set
		{
			_MinNumStore = value;
			IsSetMinNumStore = true;
		}
    }
    public bool IsSetMaxNumStore; 
    public bool IsMaxNumStoreNullable   
    { 
		get { return false;  } 
    }
    public double MaxNumStore
    {
        get{ return _MaxNumStore;  }
        set
		{
			_MaxNumStore = value;
			IsSetMaxNumStore = true;
		}
    }
    public bool IsSetUnitID; 
    public bool IsUnitIDNullable   
    { 
		get { return false;  } 
    }
    public string UnitID
    {
        get{ return _UnitID;  }
        set
		{
			_UnitID = value;
			IsSetUnitID = true;
		}
    }
    public bool IsSetGroupID; 
    public bool IsGroupIDNullable   
    { 
		get { return false;  } 
    }
    public string GroupID
    {
        get{ return _GroupID;  }
        set
		{
			_GroupID = value;
			IsSetGroupID = true;
		}
    }
    public bool IsSetIsUsed; 
    public bool IsIsUsedNullable   
    { 
		get { return false;  } 
    }
    public string IsUsed
    {
        get{ return _IsUsed;  }
        set
		{
			_IsUsed = value;
			IsSetIsUsed = true;
		}
    }
    public bool IsSetFirstBalancer; 
    public bool IsFirstBalancerNullable   
    { 
		get { return false;  } 
    }
    public double FirstBalancer
    {
        get{ return _FirstBalancer;  }
        set
		{
			_FirstBalancer = value;
			IsSetFirstBalancer = true;
		}
    }
    public bool IsSetIDPOS; 
    public bool IsIDPOSNullable   
    { 
		get { return false;  } 
    }
    public string IDPOS
    {
        get{ return _IDPOS;  }
        set
		{
			_IDPOS = value;
			IsSetIDPOS = true;
		}
    }
public DM_WAREHOUSEMETERIALList DM_WAREHOUSEMETERIALList 
{ 
	get { return _listDM_WAREHOUSEMETERIAL; }
	set { _listDM_WAREHOUSEMETERIAL = value;}
}
public QT_EXPORTDETAIL_METERIALList QT_EXPORTDETAIL_METERIALList 
{ 
	get { return _listQT_EXPORTDETAIL_METERIAL; }
	set { _listQT_EXPORTDETAIL_METERIAL = value;}
}
public QT_EXPORTDETAIL_METERIAL_TEMPList QT_EXPORTDETAIL_METERIAL_TEMPList 
{ 
	get { return _listQT_EXPORTDETAIL_METERIAL_TEMP; }
	set { _listQT_EXPORTDETAIL_METERIAL_TEMP = value;}
}
public QT_IMPORTDETIAL_METERIALList QT_IMPORTDETIAL_METERIALList 
{ 
	get { return _listQT_IMPORTDETIAL_METERIAL; }
	set { _listQT_IMPORTDETIAL_METERIAL = value;}
}
public QT_IMPORTDETIAL_METERIAL_TEMPList QT_IMPORTDETIAL_METERIAL_TEMPList 
{ 
	get { return _listQT_IMPORTDETIAL_METERIAL_TEMP; }
	set { _listQT_IMPORTDETIAL_METERIAL_TEMP = value;}
}
public QT_QUANTITATIVEList QT_QUANTITATIVEList 
{ 
	get { return _listQT_QUANTITATIVE; }
	set { _listQT_QUANTITATIVE = value;}
}

        #endregion

        #region Constructors
        public DM_METERIAL()
        {
            Reset();
        }
        public DM_METERIAL(DM_METERIAL obj)
        {
            	this._ID = obj.ID;
	this._Name = obj.Name;
	this._Price = obj.Price;
	this._MinNumStore = obj.MinNumStore;
	this._MaxNumStore = obj.MaxNumStore;
	this._UnitID = obj.UnitID;
	this._GroupID = obj.GroupID;
	this._IsUsed = obj.IsUsed;
	this._FirstBalancer = obj.FirstBalancer;
	this._IDPOS = obj.IDPOS;
        }
        #endregion

        public void Reset()
        {
                     _ID = EmptyValues.v_string;
         _Name = EmptyValues.v_string;
         _Price = EmptyValues.v_double;
         _MinNumStore = EmptyValues.v_double;
         _MaxNumStore = EmptyValues.v_double;
         _UnitID = EmptyValues.v_string;
         _GroupID = EmptyValues.v_string;
         _IsUsed = EmptyValues.v_string;
         _FirstBalancer = EmptyValues.v_double;
         _IDPOS = EmptyValues.v_string;
	_listDM_WAREHOUSEMETERIAL = null;
	_listQT_EXPORTDETAIL_METERIAL = null;
	_listQT_EXPORTDETAIL_METERIAL_TEMP = null;
	_listQT_IMPORTDETIAL_METERIAL = null;
	_listQT_IMPORTDETIAL_METERIAL_TEMP = null;
	_listQT_QUANTITATIVE = null;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["ID"] is DBNull))
		{
			obj.ID = (string)reader["ID"];
		}
                if(!(reader["Name"] is DBNull))
		{
			obj.Name = (string)reader["Name"];
		}
                if(!(reader["Price"] is DBNull))
		{
			obj.Price = (double)reader["Price"];
		}
                if(!(reader["MinNumStore"] is DBNull))
		{
			obj.MinNumStore = (double)reader["MinNumStore"];
		}
                if(!(reader["MaxNumStore"] is DBNull))
		{
			obj.MaxNumStore = (double)reader["MaxNumStore"];
		}
                if(!(reader["UnitID"] is DBNull))
		{
			obj.UnitID = (string)reader["UnitID"];
		}
                if(!(reader["GroupID"] is DBNull))
		{
			obj.GroupID = (string)reader["GroupID"];
		}
                if(!(reader["IsUsed"] is DBNull))
		{
			obj.IsUsed = (string)reader["IsUsed"];
		}
                if(!(reader["FirstBalancer"] is DBNull))
		{
			obj.FirstBalancer = (double)reader["FirstBalancer"];
		}
                if(!(reader["IDPOS"] is DBNull))
		{
			obj.IDPOS = (string)reader["IDPOS"];
		}
//            _ID = (reader["ID"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["ID"];
//            _Name = (reader["Name"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Name"];
//            _Price = (reader["Price"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["Price"];
//            _MinNumStore = (reader["MinNumStore"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["MinNumStore"];
//            _MaxNumStore = (reader["MaxNumStore"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["MaxNumStore"];
//            _UnitID = (reader["UnitID"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["UnitID"];
//            _GroupID = (reader["GroupID"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["GroupID"];
//            _IsUsed = (reader["IsUsed"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["IsUsed"];
//            _FirstBalancer = (reader["FirstBalancer"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["FirstBalancer"];
//            _IDPOS = (reader["IDPOS"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["IDPOS"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(string ID, string Name, double Price, double MinNumStore, double MaxNumStore, string UnitID, string GroupID, string IsUsed, double FirstBalancer, string IDPOS)
        {
                     this._ID = ID;
         this._Name = Name;
         this._Price = Price;
         this._MinNumStore = MinNumStore;
         this._MaxNumStore = MaxNumStore;
         this._UnitID = UnitID;
         this._GroupID = GroupID;
         this._IsUsed = IsUsed;
         this._FirstBalancer = FirstBalancer;
         this._IDPOS = IDPOS;
        }
    }
}